#include <QDebug>
#include "robot.h"


Robot::Robot()
{
	maxAnimationPriority = -1;
}

void Robot::addJoint(Joint newJoint)
{
	jointList.append(newJoint);
}

void Robot::addAnimation(Animation *newAnimation)
{
	animationsList.append(newAnimation);
	
	for (int i=0 ; i < animationsList.size() ; i++)
	{
		if (animationsList.last()->priority() > maxAnimationPriority)
			maxAnimationPriority = animationsList.last()->priority();
	}
}

void Robot::removeLastJoint()
{
	jointList.removeLast();
}

int Robot::getJointCount()
{
    return jointList.size();
}

QString Robot::getRobotDescription()
{
	return robotDescription;
}

QString Robot::getRobotName()
{
	return robotName;	
}

void Robot::setDescription(QString description)
{
	robotDescription = description;
}

void Robot::setName(QString name)
{
	robotName = name;
}

void Robot::reset()
{
	jointList.clear();
	animationsList.clear();
}
